<?php
	class SupportController extends Ovis_Controller
	{
		private $_menuName = 'Support';

		public function init()
		{
			parent::init();
			$this->checkInstance();
			$userInformation = Ovis_Controller::getLoggedUser();
			$this->view->assign(Sss_Ultility_CommonViewParamater::FULLNAME, $userInformation['fullname']);
		}
		public function loginAction()
		{
			$this->_redirect('/user/login');
		}
		public function indexAction()
		{
			$this->_redirect("/support/otrs");
		}
		public function otrsAction()
		{
			try{
				$userInformation = Ovis_Controller::getLoggedUser();
				if($userInformation['accounttype'] == Sss_Ultility_Setting::ACCOUNT_VENDOR){
					$this->_redirect('/user/login');
				}

				$linkTable = new Application_Model_Mapper_Link();


				$get  = $this->getRequest()->getParams();
				$isSearch = isset($get['s']) && $get['s'] == 1;
				//get order, page, limit param
				$filterParam[Sss_Ultility_CommonViewParamater::ORDERFIELD] = isset($get[Sss_Ultility_CommonViewParamater::ORDERFIELD]) ? $get[Sss_Ultility_CommonViewParamater::ORDERFIELD] : null;
				$filterParam[Sss_Ultility_CommonViewParamater::ORDERTYPE]  = isset($get[Sss_Ultility_CommonViewParamater::ORDERTYPE]) ? $get[Sss_Ultility_CommonViewParamater::ORDERTYPE] : null;
				$filterParam[Sss_Ultility_CommonViewParamater::PAGE] = isset($get[Sss_Ultility_CommonViewParamater::PAGE]) ? $get[Sss_Ultility_CommonViewParamater::PAGE] : 1;
				//param filter: omit title text in field
				$paramName    = $isSearch ? strcmp($this->getRequest()->getParam('linkname', Sss_Ultility_CommonViewParamater::UNDERFINE), Resources::_('NAME')) == 0 ? '' : $this->getRequest()->getParam('linkname', Sss_Ultility_CommonViewParamater::UNDERFINE) : '';
				$paramUrl    = $isSearch ? strcmp($this->getRequest()->getParam('url', Sss_Ultility_CommonViewParamater::UNDERFINE), Resources::_('URL')) == 0 ? '' : $this->getRequest()->getParam('url', Sss_Ultility_CommonViewParamater::UNDERFINE) : '';

				//get filter
				$filterParam['linkname']    = $this->getValueRequest('linkname', trim($paramName), Sss_Ultility_SessionName::OVIS_OTRS_SEESION);
				$filterParam['url']    = $this->getValueRequest('url', trim($paramUrl), Sss_Ultility_SessionName::OVIS_OTRS_SEESION);

				if ($userInformation && $userInformation['accounttype'] == Sss_Ultility_Setting::ACCOUNT_OVIS) {
					//delete ticket
					$deleteLinkId = $this->getRequest()->getParam(Sss_Ultility_CommonViewParamater::DELETE_LINK_ID, -1);
					if (isset($deleteLinkId) && $deleteLinkId != -1) {
						$arrLinkId = array(
						'linkid' => (int) $deleteLinkId
						);
						$deleteId  = $linkTable->deleteRecord($arrLinkId, false);
						if (isset($deleteId)) {
							$this->view->assign(Sss_Ultility_CommonViewParamater::NOTICEMSG, Resources::_('DELETE_LINK_SUCCESSFULL'));
						} else {
							$this->view->assign(Sss_Ultility_CommonViewParamater::NOTICEMSG, Resources::_('DELETE_LINK_FAIL'));
						}
					}
				}

				//get link list
				$list = $linkTable->getOTRS($this->view->limit, 0, $filterParam, $userInformation['accounttype'] != Sss_Ultility_Setting::ACCOUNT_OVIS ? $userInformation['accountid'] : null);
				$row  = $list->list;
				$pagination = $list->pagination;

				$this->view->assign(Sss_Ultility_CommonViewParamater::FILTER_PARAM, $filterParam);
				$this->view->assign(Sss_Ultility_CommonViewParamater::ROW, $row);
				$this->view->assign(Sss_Ultility_CommonViewParamater::PAGINATION, $pagination);
				$orderQueryString = '';
				if ($isSearch) {
					$orderQueryString = '&' . Sss_Ultility_CommonViewParamater::PAGE . '=' . $filterParam[Sss_Ultility_CommonViewParamater::PAGE] . '&s=1';
				} else {
					$orderQueryString = '&' . Sss_Ultility_CommonViewParamater::PAGE . '=' . $filterParam[Sss_Ultility_CommonViewParamater::PAGE];
				}
				$queryString = '';
				if ($isSearch) {
					$queryString .= '&s=1';
				}
				if (!is_null($filterParam[Sss_Ultility_CommonViewParamater::ORDERFIELD])){
					$queryString .= '&' . Sss_Ultility_CommonViewParamater::ORDERFIELD . '=' . $filterParam[Sss_Ultility_CommonViewParamater::ORDERFIELD];
				}
				if (!is_null($filterParam[Sss_Ultility_CommonViewParamater::ORDERTYPE])){
					$queryString .= '&' . Sss_Ultility_CommonViewParamater::ORDERTYPE . '=' . $filterParam[Sss_Ultility_CommonViewParamater::ORDERTYPE];
				}
				$this->view->assign(Sss_Ultility_CommonViewParamater::QUERY_STRING, $queryString);
				$this->view->assign(Sss_Ultility_CommonViewParamater::ORDER_QUERY_STRING, $orderQueryString);

				//get breadscrumb
				$breadscrumbs = array(
				new Sss_CommonEntity_BreadScrumb($this->_menuName, ''),
				new Sss_CommonEntity_BreadScrumb(Resources::_('OTRS'), '#')
				);
				$this->view->assign(Sss_Ultility_CommonViewParamater::BREADSCRUMBS, $breadscrumbs);

				//Create session with url auto login OTRS
				$sessionAutoLoginUrl = new Zend_Session_Namespace(Sss_Ultility_SessionName::OVIS_AUTO_LOGIN_SESSION);
				$this->view->assign("autolink",$sessionAutoLoginUrl->autourl);
				if($sessionAutoLoginUrl->autourl == null || $sessionAutoLoginUrl->autourl == ''){
					$this->view->assign(Sss_Ultility_CommonViewParamater::MSG, Resources::_("LOGIN_OTRS_FAIL"));
				}
			}
			catch(Exception $e){
				Sss_Ultility_Common::logger()->log($e, Zend_Log::ERR);
				$this->redirect($e->getMessage(),$this->view->url(array(
				Sss_Ultility_CommonViewParamater::CONTROLLER => 'error',
				Sss_Ultility_CommonViewParamater::ACTION => 'error'
				)) );
			}
		}

		public function otrsExportAction()
		{
			$linkTable = new Application_Model_Mapper_Link();


			//get order, page, limit param
			$filterParam[Sss_Ultility_CommonViewParamater::ORDERFIELD] = isset($get[Sss_Ultility_CommonViewParamater::ORDERFIELD]) ? $get[Sss_Ultility_CommonViewParamater::ORDERFIELD] : null;
			$filterParam[Sss_Ultility_CommonViewParamater::ORDERTYPE]  = isset($get[Sss_Ultility_CommonViewParamater::ORDERTYPE]) ? $get[Sss_Ultility_CommonViewParamater::ORDERTYPE] : null;                
			$filterParam[Sss_Ultility_CommonViewParamater::PAGE] = isset($get[Sss_Ultility_CommonViewParamater::PAGE]) ? $get[Sss_Ultility_CommonViewParamater::PAGE] : 1;
			//param filter: omit title text in field
			$paramName    = strcmp($this->getRequest()->getParam('linkname', Sss_Ultility_CommonViewParamater::UNDERFINE), Resources::_('NAME')) == 0 ? '' : $this->getRequest()->getParam('linkname', Sss_Ultility_CommonViewParamater::UNDERFINE);
			$paramUrl    = strcmp($this->getRequest()->getParam('url', Sss_Ultility_CommonViewParamater::UNDERFINE), Resources::_('URL')) == 0 ? '' : $this->getRequest()->getParam('url', Sss_Ultility_CommonViewParamater::UNDERFINE);

			//get filter
			$filterParam['linkname']    = $this->getValueRequest('linkname', trim($paramName), Sss_Ultility_SessionName::OVIS_OTRS_SEESION);
			$filterParam['url']    = $this->getValueRequest('url', trim($paramUrl), Sss_Ultility_SessionName::OVIS_OTRS_SEESION);

			//get link list
			$list = $linkTable->getOTRS(-1, 0, $filterParam);
			$row  = $list->list;

			$pagination = $list->pagination;
			$rowAll        = $list->list;
			$pagination = $list->pagination;
			$count = ((($pagination->pagecurrent * Sss_Ultility_Setting::PAGE_SIZE) - Sss_Ultility_Setting::PAGE_SIZE));
			$columnNames = array(
			Resources::_('ID'),
			Resources::_('NAME'),
			Resources::_('URL'),
			Resources::_('SENSOR_NAME')
			);

			$arrData = array();
			$index = 0;
			foreach((array)$rowAll as $row) {
				$count++;
				$arrData[$index][] = $count;
				$arrData[$index][] = $row['linkname'];
				$arrData[$index][] = $row['url'];
				$arrData[$index][] = $row['hardwarename'];
				$index++;
			}
			$this->exportDataToExcel($columnNames, $arrData, Resources::_('OTRS'));
		}

		public function addOtrsAction()
		{
			$userInformation = Ovis_Controller::getLoggedUser();
			if($userInformation['accounttype'] != Sss_Ultility_Setting::ACCOUNT_OVIS){
				$this->_redirect('/user/login');
				return;
			}
			$linkTable = new Application_Model_Mapper_Link();
			$hardwareTable = new Application_Model_Mapper_Hardware();

			$params     = $this->getRequest()->getPost();

			//get hardware
			$hardware = $hardwareTable->getAllHardware();

			$ArrHardware = array();
			$dataAuto = '';
			foreach($hardware as $sl) {
				$ArrHardware[$sl['hardwarename']]= $sl['hardwareid'];
			}
			foreach ($ArrHardware as $key=>$value) {
				$dataAuto = $dataAuto."$key|$value#";
			}
			$dataAuto = substr($dataAuto, 0 ,strlen($dataAuto) - 1);
			$this->view->assign(Sss_Ultility_CommonViewParamater::AUTOCOMPLETE, $dataAuto);

			// save ticket
			if (isset($params[Sss_Ultility_CommonViewParamater::BTN_SAVE])) {
				if ($userInformation) {
					$createBy = $userInformation['accountid'];
					$hardwareId = $params['hardwareid'] == '' ? -1 : $params['hardwareid'];
					$hardware = false;
					if($hardwareId != -1){
						$hardware = $hardwareTable->getHardwareById($hardwareId);
					}

					$stockLocation = $hardware == false ? -1 : $hardware->stocklocationid;
					if($stockLocation == ''){
						$stockLocation = -1;
					}
					// Process add ticket
					$linkContructor = new Application_Model_Link();
					$linkContructor->setLinkName(addslashes($params['linkname']));
					$linkContructor->setCreatedDate(Sss_Ultility_Common::getDateTimeNumber());
					$linkContructor->setCreatedBy($createBy);
					$linkContructor->setHardware($hardwareId);
					$linkContructor->setIsused(1);
					$linkContructor->setUrl(addslashes($params['url']));
					$linkContructor->setStockLocation($stockLocation);
					$id = $linkTable->save($linkContructor);
					if (isset($id)) {
						$this->redirect(Resources::_('ADD_OTRS_SUCCESSFULL'), $this->view->url(array(
						Sss_Ultility_CommonViewParamater::CONTROLLER => $this->view->controllerName,
						Sss_Ultility_CommonViewParamater::ACTION => 'otrs'
						)) );
					} else {
						$this->redirect(Resources::_('ADD_OTRS_FAIL'), $this->view->url(array(
						Sss_Ultility_CommonViewParamater::CONTROLLER => $this->view->controllerName,
						Sss_Ultility_CommonViewParamater::ACTION => 'otrs'
						)) );
					}
				}
			}

			//get breadscrumb
			$breadscrumbs = array(
			new Sss_CommonEntity_BreadScrumb($this->_menuName, ''),
			new Sss_CommonEntity_BreadScrumb(Resources::_('OTRS'), '#'),
			new Sss_CommonEntity_BreadScrumb(Resources::_('ADD_NEW_OTRS'), '#')
			);
			$this->view->assign(Sss_Ultility_CommonViewParamater::BREADSCRUMBS, $breadscrumbs);
		}
		public function manualAction()
		{
			$userInformation = Ovis_Controller::getLoggedUser();
			$documentTable = new Application_Model_Mapper_Document();
			$get  = $this->getRequest()->getParams();
			$isSearch = isset($get['s']) && $get['s'] == 1;

			//get order, page, limit param
			$filterParam[Sss_Ultility_CommonViewParamater::ORDERFIELD] = isset($get[Sss_Ultility_CommonViewParamater::ORDERFIELD]) ? $get[Sss_Ultility_CommonViewParamater::ORDERFIELD] : null;
			$filterParam[Sss_Ultility_CommonViewParamater::ORDERTYPE]  = isset($get[Sss_Ultility_CommonViewParamater::ORDERTYPE]) ? $get[Sss_Ultility_CommonViewParamater::ORDERTYPE] : null;
			$filterParam[Sss_Ultility_CommonViewParamater::PAGE] = isset($get[Sss_Ultility_CommonViewParamater::PAGE]) ? $get[Sss_Ultility_CommonViewParamater::PAGE] : 1;
			
			//param filter: omit title text in field
			$paramDocumentName    = $isSearch ? strcmp($this->getRequest()->getParam('documentname', Sss_Ultility_CommonViewParamater::UNDERFINE), Resources::_('MANUAL_NAME')) == 0 ? '' : $this->getRequest()->getParam('documentname', Sss_Ultility_CommonViewParamater::UNDERFINE) : '';
			$paramVendorName    = $isSearch ? strcmp($this->getRequest()->getParam('vendorname', Sss_Ultility_CommonViewParamater::UNDERFINE), Resources::_('VENDOR')) == 0 ? '' : $this->getRequest()->getParam('vendorname', Sss_Ultility_CommonViewParamater::UNDERFINE) : '';
			$paramDocumentType = $isSearch ? strcmp($this->getRequest()->getParam('documenttype', Sss_Ultility_CommonViewParamater::UNDERFINE), Resources::_('TYPE')) == 0 ? '' : $this->getRequest()->getParam('documenttype', Sss_Ultility_CommonViewParamater::UNDERFINE) : '';


			//get filter
			$filterParam['documentname']    = $this->getValueRequest(Sss_Ultility_CommonViewParamater::FIX . 'documentname', trim($paramDocumentName), Sss_Ultility_SessionName::OVIS_MANUAL_SESSION);
			$filterParam['vendorname']    = $this->getValueRequest(Sss_Ultility_CommonViewParamater::FIX . 'vendorname', trim($paramVendorName), Sss_Ultility_SessionName::OVIS_MANUAL_SESSION);
			$filterParam['documenttype'] = $this->getValueRequest(Sss_Ultility_CommonViewParamater::FIX . 'documenttype', trim($paramDocumentType), Sss_Ultility_SessionName::OVIS_MANUAL_SESSION);

			$filePath = $this->getRequest()->getParam(Sss_Ultility_CommonViewParamater::FILEPATH, -1);
			if($filePath != -1) {
				Sss_Ultility_Common::downloadFile($filePath);
				$this->redirect($this->view->url(array(
				Sss_Ultility_CommonViewParamater::CONTROLLER => $this->view->controllerName,
				Sss_Ultility_CommonViewParamater::ACTION => $this->view->actionName
				)));
			}
			$list = $documentTable->loadListManual($this->view->limit, 0, $filterParam, $userInformation['accounttype'] != Sss_Ultility_Setting::ACCOUNT_OVIS ? $userInformation['accountid'] : null);
			$row  = $list->list;
			$pagination = $list->pagination;
			$this->view->assign(Sss_Ultility_CommonViewParamater::FILTER_PARAM, $filterParam);
			$this->view->assign(Sss_Ultility_CommonViewParamater::ROW, $row);
			$this->view->assign(Sss_Ultility_CommonViewParamater::PAGINATION, $pagination);
			$orderQueryString = '';
			if ($isSearch) {
				$orderQueryString = '&' . Sss_Ultility_CommonViewParamater::PAGE . '=' . $filterParam[Sss_Ultility_CommonViewParamater::PAGE] . '&s=1';
			} else {
				$orderQueryString = '&' . Sss_Ultility_CommonViewParamater::PAGE . '=' . $filterParam[Sss_Ultility_CommonViewParamater::PAGE];
			}
			$queryString = '';
			if ($isSearch) {
				$queryString .= '&s=1';
			}
			if (!is_null($filterParam[Sss_Ultility_CommonViewParamater::ORDERFIELD])) {
				$queryString .= '&' . Sss_Ultility_CommonViewParamater::ORDERFIELD . '=' . $filterParam[Sss_Ultility_CommonViewParamater::ORDERFIELD];
			}
			if (!is_null($filterParam[Sss_Ultility_CommonViewParamater::ORDERTYPE])) {
				$queryString .= '&' . Sss_Ultility_CommonViewParamater::ORDERTYPE . '=' . $filterParam[Sss_Ultility_CommonViewParamater::ORDERTYPE];
			}
			$this->view->assign(Sss_Ultility_CommonViewParamater::QUERY_STRING, $queryString);
			$this->view->assign(Sss_Ultility_CommonViewParamater::ORDER_QUERY_STRING, $orderQueryString);
			$userInformation = Ovis_Controller::getLoggedUser();
			if ($userInformation) {
				//delete user ovis
				$documentId = $this->getRequest()->getParam('documentid', -1);
				if (isset($documentId) && $documentId != -1) {
					//Delete document
					$deleteId = $documentTable->deleteRow((int) $documentId);
					$message = isset($deleteId) ? Resources::_('DELETE_MANUAL_SUCCESSFULL') : Resources::_('DELETE_MANUAL_FAIL');
					$this->redirect($message, $this->view->url(array(
					Sss_Ultility_CommonViewParamater::CONTROLLER => $this->view->controllerName,
					Sss_Ultility_CommonViewParamater::ACTION => $this->view->actionName
					)));
				}
			}
			//action button
			$actionbuttons = array(
			new Sss_CommonEntity_ActionButton(Sss_Ultility_ActionButtonType::ADD, 'add-manual', Resources::_('ADD_NEW_MANUAL')),
			new Sss_CommonEntity_ActionButton(Sss_Ultility_ActionButtonType::EXPORT, 'manual-export?export=1', Resources::_('EXPORT')),
			new Sss_CommonEntity_ActionButton(Sss_Ultility_ActionButtonType::PRINTF, 'manual-export?print=1', Resources::_('PRINT')),
			new Sss_CommonEntity_ActionButton(Sss_Ultility_ActionButtonType::SEARCH, 'javascript:hideShow(this);', Resources::_('SEARCH'))
			);
			if($userInformation['accounttype'] != Sss_Ultility_Setting::ACCOUNT_OVIS){
				$actionbuttons = array(
				new Sss_CommonEntity_ActionButton(Sss_Ultility_ActionButtonType::EXPORT, 'manual-export?export=1', Resources::_('EXPORT')),
				new Sss_CommonEntity_ActionButton(Sss_Ultility_ActionButtonType::PRINTF, 'manual-export?print=1', Resources::_('PRINT')),
				new Sss_CommonEntity_ActionButton(Sss_Ultility_ActionButtonType::SEARCH, 'javascript:hideShow(this);', Resources::_('SEARCH'))
				);  
			}
			$this->view->assign(Sss_Ultility_CommonViewParamater::ACTION_BUTTONS, $actionbuttons);
			
			//get breadscrumb
			$breadscrumbs = array(
			new Sss_CommonEntity_BreadScrumb($this->_menuName, ''),
			new Sss_CommonEntity_BreadScrumb(Resources::_('MANUAL'), '#')
			);
			$this->view->assign(Sss_Ultility_CommonViewParamater::BREADSCRUMBS, $breadscrumbs);
		}
		public function manualExportAction()
		{
			$documentTable = new Application_Model_Mapper_Document();
			
			//get order, page, limit param
			$filterParam[Sss_Ultility_CommonViewParamater::ORDERFIELD] = isset($get[Sss_Ultility_CommonViewParamater::ORDERFIELD]) ? $get[Sss_Ultility_CommonViewParamater::ORDERFIELD] : null;
			$filterParam[Sss_Ultility_CommonViewParamater::ORDERTYPE]  = isset($get[Sss_Ultility_CommonViewParamater::ORDERTYPE]) ? $get[Sss_Ultility_CommonViewParamater::ORDERTYPE] : null;                
			$filterParam[Sss_Ultility_CommonViewParamater::PAGE] = isset($get[Sss_Ultility_CommonViewParamater::PAGE]) ? $get[Sss_Ultility_CommonViewParamater::PAGE] : 1;

			//param filter: omit title text in field
			$paramDocumentName    = strcmp($this->getRequest()->getParam('documentname', Sss_Ultility_CommonViewParamater::UNDERFINE), Resources::_('MANUAL_NAME')) == 0 ? '' : $this->getRequest()->getParam('documentname', Sss_Ultility_CommonViewParamater::UNDERFINE);

			$paramVendorName    = strcmp($this->getRequest()->getParam('vendorname', Sss_Ultility_CommonViewParamater::UNDERFINE), Resources::_('VENDOR')) == 0 ? '' : $this->getRequest()->getParam('vendorname', Sss_Ultility_CommonViewParamater::UNDERFINE);

			$paramDocumentType = strcmp($this->getRequest()->getParam('documenttype', Sss_Ultility_CommonViewParamater::UNDERFINE), Resources::_('TYPE')) == 0 ? '' : $this->getRequest()->getParam('documenttype', Sss_Ultility_CommonViewParamater::UNDERFINE);



			//get filter
			$filterParam['documentname']    = $this->getValueRequest(Sss_Ultility_CommonViewParamater::FIX . 'documentname', trim($paramDocumentName), Sss_Ultility_SessionName::OVIS_MANUAL_SESSION);

			$filterParam['vendorname']    = $this->getValueRequest(Sss_Ultility_CommonViewParamater::FIX . 'vendorname', trim($paramVendorName), Sss_Ultility_SessionName::OVIS_MANUAL_SESSION);

			$filterParam['documenttype'] = $this->getValueRequest(Sss_Ultility_CommonViewParamater::FIX . 'documenttype', trim($paramDocumentType), Sss_Ultility_SessionName::OVIS_MANUAL_SESSION);

			$list       = $documentTable->loadListManual(-1, 0, $filterParam);
			$rowAll        = $list->list;
			$pagination = $list->pagination;
			$this->view->assign(Sss_Ultility_CommonViewParamater::ROW, $rowAll);  
			$this->view->assign(Sss_Ultility_CommonViewParamater::PAGINATION, $pagination);
			$count = ((($pagination->pagecurrent * Sss_Ultility_Setting::PAGE_SIZE) - Sss_Ultility_Setting::PAGE_SIZE));
			$columnNames = array(
			Resources::_('ID'),
			Resources::_('MANUAL_NAME'),
			Resources::_('VENDOR'),
			Resources::_('TYPE')
			);

			$arrData = array();
			$index = 0;
			foreach((array)$rowAll as $row)
			{
				$count++;
				$arrData[$index][] = $count;
				$arrData[$index][] = $row['documentname'];
				$arrData[$index][] = $row['vendorname'];
				$arrData[$index][] = $row['description'];
				$index++;
			}
			if(isset($_GET['export']))
				$this->exportDataToExcel($columnNames, $arrData, Resources::_('MANUAL'));
		}
		public function addManualAction()
		{
			$userInformation = Ovis_Controller::getLoggedUser();
			if($userInformation['accounttype'] != Sss_Ultility_Setting::ACCOUNT_OVIS){
				$this->_redirect('/user/login');
				return;
			}
			$documentTable = new Application_Model_Mapper_Document();
			$documentContructor = new Application_Model_Document();
			$vendorTable = new Application_Model_Mapper_Vendor();
			
			$vendors       = $vendorTable->getVendorListNotPading();
			$this->view->assign(Sss_Ultility_CommonViewParamater::VENDOR, $vendors);

			$params = $this->_request->getParams();

			//insert manual 
			if (isset($params[Sss_Ultility_CommonViewParamater::BTN_SAVE])) {
				if($userInformation)
				{
					$createBy = $userInformation['accountid'];

					//path file
					$fullPath = null;
					$fileName = $_FILES[Sss_Ultility_CommonViewParamater::FILE_UPLOAD][Sss_Ultility_CommonViewParamater::NAME];
					if ($fileName) {
						$filePath = $_FILES[Sss_Ultility_CommonViewParamater::FILE_UPLOAD][Sss_Ultility_CommonViewParamater::TMP_NAME];
						$newPath  = Sss_Ultility_CommonViewParamater::FILE_PATH_DOCUMENT . $fileName;
						move_uploaded_file($filePath, $newPath);
						$fullPath     = '/' . Sss_Ultility_CommonViewParamater::FILE_PATH_DOCUMENT . $fileName;
					}
					if ($userInformation) {
						$vendor = $params['vendor'] == '' ? null : $params['vendor'];
						$documentContructor->setDocumentName(addslashes($params['documentname']));
						$documentContructor->setVendor($vendor);
						$documentContructor->setCreatedBy($createBy);
						$documentContructor->setCreatedDate(Sss_Ultility_Common::getDateTimeNumber());
						$documentContructor->setUpdatedBy($createBy);
						$documentContructor->setUpdatedDate(Sss_Ultility_Common::getDateTimeNumber());
						$documentContructor->setDocumentType(Sss_Ultility_Setting::DOCUMENT_HARDWARE);
						$documentContructor->setDescription(addslashes($params['documenttype']));
						$documentContructor->setIsused(1);
						$documentContructor->setPath($fullPath);
						$documentContructor->setDestination(0);
						//Process adding new user  
						$documentId = $documentTable->save($documentContructor);
						if (isset($documentId)) {
							$this->redirect(Resources::_('ADD_MANUAL_SUCCESSFUL'), $this->view->url(array(
							Sss_Ultility_CommonViewParamater::CONTROLLER => $this->view->controllerName,
							Sss_Ultility_CommonViewParamater::ACTION => 'manual'
							)));
						} else {
							$this->redirect(Resources::_('ADD_MANUAL_FAIL'), $this->view->url(array(
							Sss_Ultility_CommonViewParamater::CONTROLLER => $this->view->controllerName,
							Sss_Ultility_CommonViewParamater::ACTION => 'manual'
							)));
						}
					}
				}
			}

			//get breadscrumb
			$breadscrumbs = array(
			new Sss_CommonEntity_BreadScrumb($this->_menuName, ''),
			new Sss_CommonEntity_BreadScrumb(Resources::_('MANUAL'), '#'),
			new Sss_CommonEntity_BreadScrumb(Resources::_('ADD_NEW_MANUAL'), '#')
			);
			$this->view->assign(Sss_Ultility_CommonViewParamater::BREADSCRUMBS, $breadscrumbs);
		}
		public function vendorSearchAction()
		{
			$vendorTable = new Application_Model_Mapper_Vendor();

			//get order, page, limit param
			$filterParam[Sss_Ultility_CommonViewParamater::ORDERFIELD] = $this->getValueRequest(Sss_Ultility_CommonViewParamater::ORDERFIELD, $this->getRequest()->getParam(Sss_Ultility_CommonViewParamater::ORDERFIELD, Sss_Ultility_CommonViewParamater::UNDERFINE), Sss_Ultility_SessionName::VENDOR_SESSION);
			$filterParam[Sss_Ultility_CommonViewParamater::ORDERTYPE]  = $this->getValueRequest(Sss_Ultility_CommonViewParamater::ORDERTYPE, $this->getRequest()->getParam(Sss_Ultility_CommonViewParamater::ORDERTYPE, Sss_Ultility_CommonViewParamater::UNDERFINE), Sss_Ultility_SessionName::VENDOR_SESSION);
			$filterParam[Sss_Ultility_CommonViewParamater::PAGE]       = $this->getValueRequest(Sss_Ultility_CommonViewParamater::PAGE, $this->getRequest()->getParam(Sss_Ultility_CommonViewParamater::PAGE, Sss_Ultility_CommonViewParamater::UNDERFINE), Sss_Ultility_SessionName::VENDOR_SESSION);

			$limit = $this->getValueRequest(Sss_Ultility_CommonViewParamater::LIMIT, $this->getRequest()->getParam(Sss_Ultility_CommonViewParamater::LIMIT, Sss_Ultility_CommonViewParamater::UNDERFINE), Sss_Ultility_SessionName::VENDOR_SESSION);

			//test param filter: omit title text in field
			$paramName        = strcmp($this->getRequest()->getParam(Sss_Ultility_CommonViewParamater::FIX . 'vendorname', Sss_Ultility_CommonViewParamater::UNDERFINE), Resources::_('VENDOR_NAME')) == 0 ? '' : $this->getRequest()->getParam(Sss_Ultility_CommonViewParamater::FIX . 'vendorname', Sss_Ultility_CommonViewParamater::UNDERFINE);
			$paramContact     = strcmp($this->getRequest()->getParam(Sss_Ultility_CommonViewParamater::FIX . 'contact', Sss_Ultility_CommonViewParamater::UNDERFINE), Resources::_('VENDOR_CONTACT')) == 0 ? '' : $this->getRequest()->getParam(Sss_Ultility_CommonViewParamater::FIX . 'contact', Sss_Ultility_CommonViewParamater::UNDERFINE);
			$paramSaleContact = strcmp($this->getRequest()->getParam(Sss_Ultility_CommonViewParamater::FIX . 'sale_contact', Sss_Ultility_CommonViewParamater::UNDERFINE), Resources::_('VENDOR_SALE_CONTACT')) == 0 ? '' : $this->getRequest()->getParam(Sss_Ultility_CommonViewParamater::FIX . 'sale_contact', Sss_Ultility_CommonViewParamater::UNDERFINE);

			$filterParam['vendorname']         = $this->getValueRequest(Sss_Ultility_CommonViewParamater::FIX . 'vendorname', trim($paramName), Sss_Ultility_SessionName::VENDOR_SESSION);
			$filterParam['contact']      = $this->getValueRequest(Sss_Ultility_CommonViewParamater::FIX . 'contact', trim($paramContact), Sss_Ultility_SessionName::VENDOR_SESSION);
			$filterParam['sale_contact'] = $this->getValueRequest(Sss_Ultility_CommonViewParamater::FIX . 'sale_contact', trim($paramSaleContact), Sss_Ultility_SessionName::VENDOR_SESSION);

			$limit = $this->getValueRequest(Sss_Ultility_CommonViewParamater::LIMIT, $this->getRequest()->getParam(Sss_Ultility_CommonViewParamater::LIMIT, Sss_Ultility_CommonViewParamater::UNDERFINE), Sss_Ultility_SessionName::VENDOR_SESSION);


			$list       = $vendorTable->getVendorList($limit, 0, $filterParam);
			$row        = $list->list;

			$pagination = $list->pagination;
			$this->view->assign(Sss_Ultility_CommonViewParamater::FILTER_PARAM, $filterParam);
			$this->view->assign(Sss_Ultility_CommonViewParamater::LIMIT, $limit);
			$this->view->assign(Sss_Ultility_CommonViewParamater::ROW, $row);
			$this->view->assign(Sss_Ultility_CommonViewParamater::PAGINATION, $pagination);
		}
		public function slaAction()
		{
			$userInformation = Ovis_Controller::getLoggedUser();
			if($userInformation['accounttype'] == Sss_Ultility_Setting::ACCOUNT_VENDOR){
				$this->_redirect('/user/login');
			}
			$documentTable = new Application_Model_Mapper_Document();
			$get  = $this->getRequest()->getParams();
			$isSearch = isset($get['s']) && $get['s'] == 1;
			//get order, page, limit param
			$filterParam[Sss_Ultility_CommonViewParamater::ORDERFIELD] = isset($get[Sss_Ultility_CommonViewParamater::ORDERFIELD]) ? $get[Sss_Ultility_CommonViewParamater::ORDERFIELD] : null;
			$filterParam[Sss_Ultility_CommonViewParamater::ORDERTYPE]  = isset($get[Sss_Ultility_CommonViewParamater::ORDERTYPE]) ? $get[Sss_Ultility_CommonViewParamater::ORDERTYPE] : null;
			$filterParam[Sss_Ultility_CommonViewParamater::PAGE] = isset($get[Sss_Ultility_CommonViewParamater::PAGE]) ? $get[Sss_Ultility_CommonViewParamater::PAGE] : 1;
			//param filter: omit title text in field
			$paramDocumentName    = $isSearch ? strcmp($this->getRequest()->getParam('documentname', Sss_Ultility_CommonViewParamater::UNDERFINE), Resources::_('SLA_NAME')) == 0 ? '' : $this->getRequest()->getParam('documentname', Sss_Ultility_CommonViewParamater::UNDERFINE) : '';
			$paramStockLocationName    = $isSearch ? strcmp($this->getRequest()->getParam('stocklocationname', Sss_Ultility_CommonViewParamater::UNDERFINE), Resources::_('STOCK_LOCATION')) == 0 ? '' : $this->getRequest()->getParam('stocklocationname', Sss_Ultility_CommonViewParamater::UNDERFINE) : '';
			$page = $filterParam[Sss_Ultility_CommonViewParamater::PAGE];
			//get filter
			$filterParam['documentname']    = $this->getValueRequest(Sss_Ultility_CommonViewParamater::FIX . 'documentname', trim($paramDocumentName), Sss_Ultility_SessionName::OVIS_SLA_SESSION);
			$filterParam['stocklocationname']    = $this->getValueRequest(Sss_Ultility_CommonViewParamater::FIX . 'stocklocationname', trim($paramStockLocationName), Sss_Ultility_SessionName::OVIS_SLA_SESSION);
			$filePath = $this->getRequest()->getParam(Sss_Ultility_CommonViewParamater::FILEPATH, -1);
			if($filePath != -1) {
				Sss_Ultility_Common::downloadFile($filePath);
				$this->redirect($this->view->url(array(
				Sss_Ultility_CommonViewParamater::CONTROLLER => $this->view->controllerName,
				Sss_Ultility_CommonViewParamater::ACTION => $this->view->actionName
				)));
			}
			$list = $documentTable->loadListSLA($this->view->limit, 0, $filterParam, $userInformation['accounttype'] != Sss_Ultility_Setting::ACCOUNT_OVIS ? $userInformation['accountid'] : null);			
			$row  = $list->list;
			$pagination = $list->pagination;
			$this->view->assign(Sss_Ultility_CommonViewParamater::FILTER_PARAM, $filterParam);
			$this->view->assign(Sss_Ultility_CommonViewParamater::ROW, $row);
			$this->view->assign(Sss_Ultility_CommonViewParamater::PAGINATION, $pagination);
			$orderQueryString = '';
			if ($isSearch) {
				$orderQueryString = '&' . Sss_Ultility_CommonViewParamater::PAGE . '=' . $filterParam[Sss_Ultility_CommonViewParamater::PAGE] . '&s=1';
			} else {
				$orderQueryString = '&' . Sss_Ultility_CommonViewParamater::PAGE . '=' . $filterParam[Sss_Ultility_CommonViewParamater::PAGE];
			}
			$queryString = '';
			if ($isSearch) {
				$queryString .= '&s=1';
			}
			if (!is_null($filterParam[Sss_Ultility_CommonViewParamater::ORDERFIELD])){ 
				$queryString .= '&' . Sss_Ultility_CommonViewParamater::ORDERFIELD . '=' . $filterParam[Sss_Ultility_CommonViewParamater::ORDERFIELD];
			}
			if (!is_null($filterParam[Sss_Ultility_CommonViewParamater::ORDERTYPE])) {
				$queryString .= '&' . Sss_Ultility_CommonViewParamater::ORDERTYPE . '=' . $filterParam[Sss_Ultility_CommonViewParamater::ORDERTYPE];
			}
			$this->view->assign(Sss_Ultility_CommonViewParamater::QUERY_STRING, $queryString);
			$this->view->assign(Sss_Ultility_CommonViewParamater::ORDER_QUERY_STRING, $orderQueryString);
			if ($userInformation && $userInformation['accounttype'] == Sss_Ultility_Setting::ACCOUNT_OVIS) {
				//delete user ovis
				$documentId = $this->getRequest()->getParam('documentid', -1);
				if (isset($documentId) && $documentId != -1) {
					//delete SLA
					$deleteId = $documentTable->deleteRow((int) $documentId);
					if (isset($deleteId)) {
						$this->redirect(Resources::_('DELETE_SLA_SUCCESSFULL'), $this->view->url(array(
						Sss_Ultility_CommonViewParamater::CONTROLLER => $this->view->controllerName,
						Sss_Ultility_CommonViewParamater::ACTION => $this->view->actionName
						)));
					} else {
						$this->redirect(Resources::_('DELETE_SLA_FAIL'), $this->view->url(array(
						Sss_Ultility_CommonViewParamater::CONTROLLER => $this->view->controllerName,
						Sss_Ultility_CommonViewParamater::ACTION => $this->view->actionName
						)));
					}
				}
			}
			//action button
			$actionbuttons = array(
				new Sss_CommonEntity_ActionButton(Sss_Ultility_ActionButtonType::ADD, 'add-sla', Resources::_('ADD_NEW_SLA')),
				new Sss_CommonEntity_ActionButton(Sss_Ultility_ActionButtonType::EXPORT, 'SLA-export?export=1', Resources::_('EXPORT')),
				new Sss_CommonEntity_ActionButton(Sss_Ultility_ActionButtonType::PRINTF, 'SLA-export?print=1', Resources::_('PRINT')),
				new Sss_CommonEntity_ActionButton(Sss_Ultility_ActionButtonType::SEARCH, 'javascript:hideShow(this);', Resources::_('SEARCH'))
			);
			if($userInformation['accounttype'] != Sss_Ultility_Setting::ACCOUNT_OVIS){
				$actionbuttons = array(
				new Sss_CommonEntity_ActionButton(Sss_Ultility_ActionButtonType::EXPORT, 'SLA-export?export=1', Resources::_('EXPORT')),
				new Sss_CommonEntity_ActionButton(Sss_Ultility_ActionButtonType::PRINTF, 'SLA-export?print=1', Resources::_('PRINT')),
				new Sss_CommonEntity_ActionButton(Sss_Ultility_ActionButtonType::SEARCH, 'javascript:hideShow(this);', Resources::_('SEARCH'))
				);
			}
			$this->view->assign(Sss_Ultility_CommonViewParamater::ACTION_BUTTONS, $actionbuttons);
			//get breadscrumb
			$breadscrumbs = array(
				new Sss_CommonEntity_BreadScrumb($this->_menuName, ''),
				new Sss_CommonEntity_BreadScrumb(Resources::_('SLA'), '#')
			);
			$this->view->assign(Sss_Ultility_CommonViewParamater::BREADSCRUMBS, $breadscrumbs);
		}
		public function slaExportAction()
		{
			$documentTable = new Application_Model_Mapper_Document();

			//get order, page, limit param
			$filterParam[Sss_Ultility_CommonViewParamater::ORDERFIELD] = isset($get[Sss_Ultility_CommonViewParamater::ORDERFIELD]) ? $get[Sss_Ultility_CommonViewParamater::ORDERFIELD] : null;
			$filterParam[Sss_Ultility_CommonViewParamater::ORDERTYPE]  = isset($get[Sss_Ultility_CommonViewParamater::ORDERTYPE]) ? $get[Sss_Ultility_CommonViewParamater::ORDERTYPE] : null;
			$filterParam[Sss_Ultility_CommonViewParamater::PAGE] = isset($get[Sss_Ultility_CommonViewParamater::PAGE]) ? $get[Sss_Ultility_CommonViewParamater::PAGE] : 1;
			
			//param filter: omit title text in field
			$paramDocumentName    = strcmp($this->getRequest()->getParam('documentname', Sss_Ultility_CommonViewParamater::UNDERFINE), Resources::_('SLA_NAME')) == 0 ? '' : $this->getRequest()->getParam('documentname', Sss_Ultility_CommonViewParamater::UNDERFINE);
			$paramStockLocationName    = strcmp($this->getRequest()->getParam('stocklocationname', Sss_Ultility_CommonViewParamater::UNDERFINE), Resources::_('STOCK_LOCATION')) == 0 ? '' : $this->getRequest()->getParam('stocklocationname', Sss_Ultility_CommonViewParamater::UNDERFINE);

			//get filter
			$filterParam['documentname']    = $this->getValueRequest(Sss_Ultility_CommonViewParamater::FIX . 'documentname', trim($paramDocumentName), Sss_Ultility_SessionName::OVIS_SLA_SESSION);
			$filterParam['stocklocationname']    = $this->getValueRequest(Sss_Ultility_CommonViewParamater::FIX . 'stocklocationname', trim($paramStockLocationName), Sss_Ultility_SessionName::OVIS_SLA_SESSION);
			$list = $documentTable->loadListSLA(-1, 0, $filterParam);

			$rowAll        = $list->list;
			$pagination = $list->pagination;
			$this->view->assign(Sss_Ultility_CommonViewParamater::ROW, $rowAll);  
			$this->view->assign(Sss_Ultility_CommonViewParamater::PAGINATION, $pagination);
			$count = ((($pagination->pagecurrent * Sss_Ultility_Setting::PAGE_SIZE) - Sss_Ultility_Setting::PAGE_SIZE));
			$columnNames = array(
			Resources::_('ID'),
			Resources::_('SLA_NAME'),
			Resources::_('STOCK_LOCATION')
			);

			$arrData = array();
			$index = 0;
			foreach((array)$rowAll as $row) {
				$count++;
				$arrData[$index][] = $count;
				$arrData[$index][] = $row['documentname'];
				$arrData[$index][] = $row['stocklocationname'];
				$index++;
			}
			if(isset($_GET['export']))
				$this->exportDataToExcel($columnNames, $arrData, Resources::_('SLA'));
		}
		public function stockLocationSearchAction()
		{
			$stocklocationsTable = new Application_Model_Mapper_StockLocation();

			//get order, page, limit param
			$filterParam[Sss_Ultility_CommonViewParamater::ORDERFIELD] = $this->getValueRequest(Sss_Ultility_CommonViewParamater::ORDERFIELD, $this->getRequest()->getParam(Sss_Ultility_CommonViewParamater::ORDERFIELD, Sss_Ultility_CommonViewParamater::UNDERFINE), Sss_Ultility_SessionName::STOCKLOCATIONS_SESSION);
			$filterParam[Sss_Ultility_CommonViewParamater::ORDERTYPE]  = $this->getValueRequest(Sss_Ultility_CommonViewParamater::ORDERTYPE, $this->getRequest()->getParam(Sss_Ultility_CommonViewParamater::ORDERTYPE, Sss_Ultility_CommonViewParamater::UNDERFINE), Sss_Ultility_SessionName::STOCKLOCATIONS_SESSION);
			$filterParam[Sss_Ultility_CommonViewParamater::PAGE]       = $this->getValueRequest(Sss_Ultility_CommonViewParamater::PAGE, $this->getRequest()->getParam(Sss_Ultility_CommonViewParamater::PAGE, Sss_Ultility_CommonViewParamater::UNDERFINE), Sss_Ultility_SessionName::STOCKLOCATIONS_SESSION);

			$limit = $this->getValueRequest(Sss_Ultility_CommonViewParamater::LIMIT, $this->getRequest()->getParam(Sss_Ultility_CommonViewParamater::LIMIT, Sss_Ultility_CommonViewParamater::UNDERFINE), Sss_Ultility_SessionName::STOCKLOCATIONS_SESSION);

			//test param filter: omit title text in field
			$paramName    = strcmp($this->getRequest()->getParam(Sss_Ultility_CommonViewParamater::FIX . 'stocklocationname', Sss_Ultility_CommonViewParamater::UNDERFINE), Resources::_('STOCK_LOCATION_NAME')) == 0 ? '' : $this->getRequest()->getParam(Sss_Ultility_CommonViewParamater::FIX . 'stocklocationname', Sss_Ultility_CommonViewParamater::UNDERFINE);
			$paramContact = strcmp($this->getRequest()->getParam(Sss_Ultility_CommonViewParamater::FIX . 'contact', Sss_Ultility_CommonViewParamater::UNDERFINE), Resources::_('STOCK_LOCATION_CONTACT')) == 0 ? '' : $this->getRequest()->getParam(Sss_Ultility_CommonViewParamater::FIX . 'contact', Sss_Ultility_CommonViewParamater::UNDERFINE);
			$paramType    = strcmp($this->getRequest()->getParam(Sss_Ultility_CommonViewParamater::FIX . 'stocklocationtype', Sss_Ultility_CommonViewParamater::UNDERFINE), Resources::_('STOCK_LOCATION_TYPE')) == 0 ? '' : $this->getRequest()->getParam(Sss_Ultility_CommonViewParamater::FIX . 'stocklocationtype', Sss_Ultility_CommonViewParamater::UNDERFINE);

			$page = $filterParam[Sss_Ultility_CommonViewParamater::PAGE];

			$filterParam['stocklocationname'] = $this->getValueRequest(Sss_Ultility_CommonViewParamater::FIX . 'stocklocationname', trim($paramName), Sss_Ultility_SessionName::STOCKLOCATIONS_SESSION);
			$filterParam['contact']            = $this->getValueRequest(Sss_Ultility_CommonViewParamater::FIX . 'contact', trim($paramContact), Sss_Ultility_SessionName::STOCKLOCATIONS_SESSION);
			$filterParam['stocklocationtype'] = $this->getValueRequest(Sss_Ultility_CommonViewParamater::FIX . 'stocklocationtype', trim($paramType), Sss_Ultility_SessionName::STOCKLOCATIONS_SESSION);

			$limit = $this->getValueRequest(Sss_Ultility_CommonViewParamater::LIMIT, $this->getRequest()->getParam(Sss_Ultility_CommonViewParamater::LIMIT, Sss_Ultility_CommonViewParamater::UNDERFINE), Sss_Ultility_SessionName::STOCKLOCATIONS_SESSION);

			//get Stock locations list
			$list       = $stocklocationsTable->getList($limit, 0, $filterParam);
			$row        = $list->list;
			$pagination = $list->pagination;
			$this->view->assign(Sss_Ultility_CommonViewParamater::FILTER_PARAM, $filterParam);
			$this->view->assign(Sss_Ultility_CommonViewParamater::LIMIT, $limit);
			$this->view->assign(Sss_Ultility_CommonViewParamater::ROW, $row);
			$this->view->assign(Sss_Ultility_CommonViewParamater::PAGINATION, $pagination);
		}
		public function addSlaAction()
		{
			$userInformation = Ovis_Controller::getLoggedUser();
			if($userInformation['accounttype'] != Sss_Ultility_Setting::ACCOUNT_OVIS) {
				$this->_redirect('/user/login');
			}
			$documentTable = new Application_Model_Mapper_Document();
			$documentContructor = new Application_Model_Document();
			$stockLocationTable = new Application_Model_Mapper_StockLocation();
			//get stock location
			$stockLocation = $stockLocationTable->getAllStockLocation();
			$this->view->assign(Sss_Ultility_CommonViewParamater::STOCKLOCATION, $stockLocation);
			$params = $this->_request->getParams();
			//insert sla 
			if (isset($params[Sss_Ultility_CommonViewParamater::BTN_SAVE])) {
				if($userInformation)
				{
					$createBy = $userInformation['accountid'];
					//path file
					$fullPath = null;
					$fileName = $_FILES[Sss_Ultility_CommonViewParamater::FILE_UPLOAD][Sss_Ultility_CommonViewParamater::NAME];
					if ($fileName) {
						$filePath = $_FILES[Sss_Ultility_CommonViewParamater::FILE_UPLOAD][Sss_Ultility_CommonViewParamater::TMP_NAME];
						$newPath  = Sss_Ultility_CommonViewParamater::FILE_PATH_DOCUMENT . $fileName;
						 move_uploaded_file($filePath, $newPath);
						$fullPath     = '/' . Sss_Ultility_CommonViewParamater::FILE_PATH_DOCUMENT . $fileName;
					}
					if ($userInformation) {
						$documentContructor->setDocumentName(addslashes($params['documentname']));
						$documentContructor->setCreatedBy($createBy);
						$documentContructor->setCreatedDate(Sss_Ultility_Common::getDateTimeNumber());
						$documentContructor->setUpdatedBy($createBy);
						$documentContructor->setUpdatedDate(Sss_Ultility_Common::getDateTimeNumber());
						$documentContructor->setDocumentType(Sss_Ultility_Setting::DOCUMENT_SLA);
						$documentContructor->setIsused(1);
						$documentContructor->setPath($fullPath);
						$documentContructor->setDestination($params['destination']);
						//Process adding new user
						$documentId = $documentTable->save($documentContructor);
						if (isset($documentId)) {
							$this->redirect(Resources::_('ADD_SLA_SUCCESSFUL'), $this->view->url(array(
							Sss_Ultility_CommonViewParamater::CONTROLLER => $this->view->controllerName,
							Sss_Ultility_CommonViewParamater::ACTION => 'sla'
							)));
						} else {
							$this->redirect(Resources::_('ADD_SLA_FAIL'), $this->view->url(array(
							Sss_Ultility_CommonViewParamater::CONTROLLER => $this->view->controllerName,
							Sss_Ultility_CommonViewParamater::ACTION => 'sla'
							)));
						}
					}
				}
			}
			//get breadscrumb
			$breadscrumbs = array(
			new Sss_CommonEntity_BreadScrumb($this->_menuName, ''),
			new Sss_CommonEntity_BreadScrumb(Resources::_('SLA'), '#'),
			new Sss_CommonEntity_BreadScrumb(Resources::_('ADD_NEW_SLA'), '#')
			);
			$this->view->assign(Sss_Ultility_CommonViewParamater::BREADSCRUMBS, $breadscrumbs);
		}
	}
